<?php

namespace App\Domain\ChannelContact\Rules;

use Illuminate\Foundation\Http\FormRequest;

class CreateChannelContractPost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|string',
            'channel_name' => 'required|string',
            'channel_id' => 'required|string',
            'start_time' => 'required',
            'end_time' => 'required',
            'status' => 'required',
            'enclosure' => 'required',
            'signatory' => ''
        ];
    }

    public function messages()
    {
        return [
            'name.required' => '合同名称必填',
            'channel_name.required' => '渠道商名称必填',
            'channel_id.required' => '渠道商ID必填',
            'start_time.required' => '合作开始时间必填',
            'end_time.required' => '合作结束时间必填',
            'status.required' => '状态必填',
            'enclosure.required' => '附件必选',
            'signatory' => '',
        ];
    }
}
